package com.teng.mylibrary.widget

import android.app.Dialog
import android.content.Context
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import com.teng.mylibrary.R

/**
 * Description:  自定义加载框
 * Author:       liuteng
 * CreateDate:   2021/12/17 16:35
 * UpdateRemark: 更新说明
 */
class ProgressDialog(private val mContext: Context, themeId: Int) :
    Dialog(mContext, themeId) {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setCanceledOnTouchOutside(false)
        var view: View = LayoutInflater.from(mContext).inflate(R.layout.loading_view, null)
        setContentView(view)

        setOnKeyListener { dialog, keyCode, event ->
            dismiss()
            false
        }
    }
}